package it.antonio.ilpizze.db.core.fs;

import java.io.File;
import java.nio.ByteBuffer;

import it.antonio.ilpizze.db.io.IOFile;

public class BtreeIndexFile extends IOFile{
	private IOFile file;

	public BtreeIndexFile(IOFile file) {
		this.file = file;
	}

	public String property(){
		String fileName = file.name();
		return fileName.substring(fileName.indexOf("btree_index_") + 11, fileName.lastIndexOf(".")); 
	}
	
	// DELEGATES
	
	public byte[] readBytes(int size) {
		return file.readBytes(size);
	}

	public ByteBuffer readByteBuffer(int size) {
		return file.readByteBuffer(size);
	}

	public String readString() {
		return file.readString();
	}

	public int readInt() {
		return file.readInt();
	}

	public boolean readBoolean() {
		return file.readBoolean();
	}

	public long readLong() {
		return file.readLong();
	}

	public short readShort() {
		return file.readShort();
	}

	public float readFloat() {
		return file.readFloat();
	}

	public double readDouble() {
		return file.readDouble();
	}

	public byte readByte() {
		return file.readByte();
	}

	public void writeBytes(byte[] bytes) {
		file.writeBytes(bytes);
	}

	public void writeByteBuffer(ByteBuffer buffer) {
		file.writeByteBuffer(buffer);
	}

	public void writeString(String value) {
		file.writeString(value);
	}

	public void writeInt(int value) {
		file.writeInt(value);
	}

	public void writeLong(long value) {
		file.writeLong(value);
	}

	public void writeShort(short value) {
		file.writeShort(value);
	}

	public void writeFloat(float value) {
		file.writeFloat(value);
	}

	public void writeDouble(double value) {
		file.writeDouble(value);
	}

	public void writeByte(byte value) {
		file.writeByte(value);
	}

	public void synch() {
		file.synch();
	}

	public long position() {
		return file.position();
	}

	public void position(long position) {
		file.position(position);
	}

	public void close() {
		file.close();
	}

	public int size() {
		return file.size();
	}

	public boolean delete() {
		return file.delete();
	}

	public boolean equals(Object arg0) {
		return file.equals(arg0);
	}

	public int hashCode() {
		return file.hashCode();
	}

	public void open() {
		file.open();
	}

	public String name() {
		return file.name();
	}

	public boolean lock(int milliseconds) {
		return file.lock(milliseconds);
	}

	public boolean isLocked() {
		return file.isLocked();
	}

	public File original() {
		return file.original();
	}

	public void renameTo(String string) {
		file.renameTo(string);
	}

	public String toString() {
		return file.toString();
	}

	public void writeBoolean(boolean value) {
		file.writeBoolean(value);
	}

	public void unlock() {
		file.unlock();
	}
	
	
}
